const mongoose = require('mongoose')
const {Schema} = mongoose
//


var SettingSchema = new Schema({

    type: {type: Number, enum: [1,2,3,4,5], required: true},      //辅助类型 1.服务条款及隐私政策 2.模拟考试设置

    content: {type: String, required: true},                          //   内容

    create_at: {type: Date, default: Date.now, index: -1},
    update_at: {type: Date, default: Date.now},
})

SettingSchema.pre('save', function (next) {
    let now = new Date()
    this.update_at = now
    next()
})
mongoose.model('setting', SettingSchema)
module.exports = SettingSchema
